<cfoutput><cfif isdefined("url.terminal")>
<cfset session.terminal = "#url.terminal#">

</cfif></cfoutput>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EPOS Login</title>
<link rel="stylesheet" href="css/lightbox.css" media="screen,projection" type="text/css" />
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/lightbox.js"></script>



<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
}
body {
	background-image: url(images/bg.png);
	background-repeat: repeat-x;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
#container {
	width:1005px; margin-left:auto; margin-right:auto;
	height:750px;
	text-align:center;

}
#logo {
	position:relative;
	float:left;
	top:10px;
	width:278px;
	height:75px;
	z-index:1;
	left:10px;
}
#content {
	position:relative;
	background-image:url(images/main.png);
	background-repeat:no-repeat;
	float:center;
	width:1000px;
	height:595px;
	z-index:2;
	top: 50px;
}
#order {
	position:absolute;
	background-image:url(images/orderbg.png);
	background-repeat:no-repeat;
	float:center;
	width:698px;
	height:548px;
	z-index:2;
	top: 22px;
	left: 20px;
}
#menu {
	position:absolute;
	width:242px;
	height:546px;
	left: 721px;
	top: 25px;
}
#links {
	position:relative;
	float:left;
	width:404px;
	height:20px;
	z-index:3;
	text-align:left;
	left: 30px;
	top: 100px;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
#myframe {
	position:absolute;
	float:left;
	top:14px;
	width:672px;
	height:515px;
	z-index:4;
	left: 14px;
}
#topnav {
	position:relative;
	float:left;
	top:49px;
	width:550px;
	height:47px;
	z-index:3;
	left: 185px;
}

#load{
position:absolute;
z-index:1;
border:3px double #999;
background:#f7f7f7;
width:300px;
height:200px;
margin-top:-150px;
margin-left:-150px;
top:50%;
left:50%;
text-align:center;
line-height:200px;
font-family:"Trebuchet MS", verdana, arial,tahoma;
font-size:18pt;


}


.style6 {font-size: 29.9px}
#admin {
	position:absolute;
	left:859px;
	top:16px;
	width:317px;
	height:22px;
	z-index:4;
}
-->
</style>
<cfoutput>

<script language='JavaScript'>

    Memory  = "0";      // initialise memory variable
    Current = "0";      //   and value of Display ("current" value)
    Operation = 0;      // Records code for eg * / etc.
    MAXLENGTH = 30;     // maximum number of digits before decimal!
 
function AddDigit(dig)          //ADD A DIGIT TO DISPLAY (keep as 'Current')
 { if (Current.indexOf("!") == -1)  //if not already an error
    { if (    (eval(Current) == 0)
              && (Current.indexOf(".") == -1)
         ) { Current = dig;
           } else
           { Current = Current + dig;
           };
      Current = Current.toLowerCase(); //FORCE LOWER CASE
    } else
    { Current = "Hint! Press 'AC'";  //Help out, if error present.
    };
   if (Current.indexOf("e0") != -1)
     { var epos = Current.indexOf("e");
       Current = Current.substring(0,epos+1) + Current.substring(epos+2);
     };
  if (Current.length > MAXLENGTH)
     { Current = "Aargh! Too long"; //don't allow over MAXLENGTH digits before "." ???
     };
   document.Calculator.Display.value = Current;
 }
 
function Dot()                  //PUT IN "." if appropriate.
 {
  if ( Current.length == 0)     //no leading ".", use "0."
    { Current = "0.";
    } else
    {  if (   ( Current.indexOf(".") == -1)
            &&( Current.indexOf("e") == -1)
          )
         { Current = Current + ".";
    };   };
  document.Calculator.Display.value = Current;
 }
 
function DoExponent()
 {
  if ( Current.indexOf("e") == -1 )
       { Current = Current + "e0";
         document.Calculator.Display.value = Current;
       };
 }
 
function PlusMinus()
 {
  if  (Current.indexOf("e") != -1)
    { var epos = Current.indexOf("e-");
      if (epos != -1)
         { Current = Current.substring(0,1+epos) + Current.substring(2+epos); //clip out -ve exponent 
         } else
         { epos = Current.indexOf("e");
           Current = Current.substring(0,1+epos) + "-" + Current.substring(1+epos); //insert -ve exponent
         };
    } else
    {  if ( Current.indexOf("-") == 0 )
         { Current = Current.substring(1);
         } else
         { Current = "-" + Current;
         };
       if (    (eval(Current) == 0)
            && (Current.indexOf(".") == -1 )
          ) { Current = "0"; };
    };
  document.Calculator.Display.value = Current;
 }
 
function Clear()                //CLEAR ENTRY
 { Current = "0";
   document.Calculator.Display.value = Current;
 }
 
function AllClear()             //Clear ALL entries!
 { Current = "0";
   Operation = 0;                //clear operation
   Memory = "0";                  //clear memory
   document.Calculator.Display.value = Current;
 }
 
function Operate(op)            //STORE OPERATION e.g. + * / etc.
 {
 if (Operation != 0) { Calculate(); }; //'Press "=" if pending operation!
 // note that design is not good for showing *intermediate* results.
 
  if (op.indexOf("*") > -1) { Operation = 1; };       //codes for *
  if (op.indexOf("/") > -1) { Operation = 2; };       // slash (divide)
  if (op.indexOf("+") > -1) { Operation = 3; };       // sum
  if (op.indexOf("-") > -1) { Operation = 4; };       // difference
 
  Memory = Current;                 //store value
  // note how e.g. Current.value gives neither error nor value! ***
  Current = "";
  document.Calculator.Display.value = Current;
 }
 
function Calculate()            //PERFORM CALCULATION (= button)
 { 
  if (Operation == 1) { Current = eval(Memory) * eval(Current); };
  if (Operation == 2)
    { if (eval(Current) != 0)
      { Current = eval(Memory) / eval(Current)
      } else
      { Current = "Aargh! Divide by zero"; //don't allow over MAXLENGTH digits before "." ???
      }
    };
  if (Operation == 3) { Current = eval(Memory) + eval(Current); };
  if (Operation == 4) { Current = eval(Memory) - eval(Current); };
  Operation = 0;                //clear operation
  Memory = "0";                  //clear memory
  Current = Current + "";       //FORCE A STRING!


  if (Current.indexOf("Infinity") != -1)        //eg "1e320" * 1
    { Current = "Aargh! Value too big";
    };
  if (Current.indexOf("NaN") != -1)        //eg "1e320" / "1e320"
    { Current = "Aargh! I don't understand";
    };
  document.Calculator.Display.value = Current;
  // NOTE: if no operation, nothing changes, Current is left the same!
 }
 
function FixCurrent()
 {
  Current = document.Calculator.Display.value;
  Current = "" + parseFloat(Current);
  if (Current.indexOf("NaN") != -1)
    { Current = "Aargh! I don't understand";
    };
  	document.Calculator.Display.value = Current;
 }
   </script>
<script language='JavaScript'>
function LenCheck()
 {
  if (document.Calculator.Display.value.length > 3) {
   document.Calculator.submit();
  }
 }
</script>
</cfoutput>

<script type="text/javascript">
var ray={
ajax:function(st)
	{
		this.show('load');
	},
show:function(el)
	{
		this.getID(el).style.display='';
	},
getID:function(el)
	{
		return document.getElementById(el);
	}
}
</script>
</head>

<body style="background-image:url(images/bg.png); background-repeat:repeat-x;margin:0px auto;text-align:center;">

<div id="container">
<div id="logo">
  <div align="left"><a href="index.cfm"><img src="images/logo.png" width="149" height="71" border="0" /></a></div>
</div>
<div id="topnav">
  <div align="left">
	<!--- <cfinclude template="_top_nav.cfm"> --->
	</div>
</div>

<div id="content"><div id="order"><div id="myframe"><cfform name="Calculator" action="loginprocess.cfm" method="post" onsubmit="return ray.ajax()">
 <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
   <tr>
     <td align="center">&nbsp;</td>
   </tr>
   <tr>
     <td align="center"><cfoutput><cfif isdefined("url.message")><span class="style10">#url.message#</span><cfelse>
           <span class="style7">Please Enter Your Employee ID Number</span>
     </cfif>
     </cfoutput></td>
   </tr>
   <tr>
     <td align="center"><p>&nbsp;</p>
       
       <table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="16%" align="center" valign="top"><a href="#" OnClick="AddDigit('1');LenCheck();"><img src="images/1.png" name="1" id="1" border="0"  /></a></td>
    <td width="16%" align="center" valign="top"><a href="#" OnClick="AddDigit('2');LenCheck();"><img src="images/2.png" name="2" id="2" border="0"  /></a></td>
    <td width="16%" align="center" valign="top"><a href="#" OnClick="AddDigit('3');LenCheck();"><img src="images/3.png" name="3" id="3" border="0"  /></a></td>
    <td width="52%" rowspan="4" align="center" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td align="center"><fieldset>
          <br />
          <input name="Display" type="password" class="style6" onchange="FixCurrent()" size="4" maxlength="4" style="text-align:center; border-color:transparent" autocomplete="off" />
          <cfoutput>
          <!---<input type="hidden" name="ProdID" value="#url.prodid#">
          <input type="hidden" name="receiptnum" value="#session.receiptnum#">
          <input type="hidden" name="TransType" value="#url.TransType#">---></cfoutput>
        <br />
        <br />
        <br />
        <br />
        <br />
        <cfinput type="image" name="submit" src="images/enter.png" onClick="submit()">
        <br />
        </fieldset></td>
      </tr>
      
    </table>      </td>
  </tr>
  <tr align="center">
    <td valign="top"><a href="#" OnClick="AddDigit('4');LenCheck();"><img src="images/4.png" name="4" id="4" border="0"  /></a></td>
    <td valign="top"><a href="#" OnClick="AddDigit('5');LenCheck();"><img src="images/5.png" name="5" id="5" border="0"  /></a></td>
    <td valign="top"><a href="#" OnClick="AddDigit('6');LenCheck();"><img src="images/6.png" name="6" id="6" border="0"  /></a></td>
    </tr>
  <tr align="center">
    <td valign="top"><a href="#" OnClick="AddDigit('7');LenCheck();"><img src="images/7.png" name="7" id="7" border="0"  /></a></td>
    <td valign="top"><a href="#" OnClick="AddDigit('8');LenCheck();"><img src="images/8.png" name="8" id="8" border="0"  /></a></td>
    <td valign="top"><a href="#" OnClick="AddDigit('9');LenCheck();"><img src="images/9.png" name="9" id="9" border="0"  /></a></td>
    </tr>
  <tr align="center">
    <td><a href="#" onclick="Clear()"><img src="images/clear.png" name="clear" id="clear" border="0"  /></a></td>
    <td><a href="#" OnClick="AddDigit('0');LenCheck();"><img src="images/0.png" name="0" id="0" border="0"  /></a></td>
    <td><a href="#" OnClick="Dot()"><img src="images/dot.png" name="." width="45" height="45" border="0" id="."  /></a></td>
    </tr>
</table></td>
   </tr>
 </table>
  </cfform></div></div>
  <div id="menu">
	<!---
    <cfinclude template="_right_nav.cfm">
	--->
  </div>
  
</div>
</div>
</body>
</html>